﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Converts string to a title case.
    /*
        sint x=s.GetWordCount();
    */

    public static partial class StringExtensions
    {
        public static int GetWordCount(this String str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return 0;
            }
            return str.Split(new char[] { ' ', '.', '?' },
                StringSplitOptions.RemoveEmptyEntries).Length;
        }
    }
}
